﻿using PerceptiveMCAPI;
//
namespace PerceptiveMCAPI_Test
{
   public partial class get_CampaignGenericParms : System.Web.UI.UserControl
   {
      public ApiMethod method { get; set; }

      public string campaignId
      {
         get { return tbCampaignId.Text.Trim(); }
         set { tbCampaignId.Text = value; }
      }
      public bool campaignContent_for_archive
      {
         get { return cbForArchive.Checked; }
         private set { cbForArchive.Checked = value; }
      }
      // ---------------------------------------
      public void Setup()
      {
         this.Visible = true;
         lblSection.Text = method.section;
         lblMethod.Text = method.name;
         tbCampaignId.Focus();
         // 
         divForArchive.Visible = false;
         if ( method.name == "campaignDelete" )
            campaignId = "";                          // clear default for delete request
         else if ( method.name == "campaignContent" )
         {
            divForArchive.Visible = true;
            cbForArchive.Checked = MCAPISettings.default_campaignContent_for_archive;
         }
      }
   }
}